home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 #32 / q32side1.d64 / t.lil red 2 < prev    next >
Text File  |  2022-08-30  |  15KB  |  277 lines

  1.  
  2.  
  3.               LITTLE RED READER  Version 2.00  (March 8, 1994)
  4.  
  5.         MS-DOS file reader/writer for the C128 and 1571/81/FD drives
  6.  
  7.       Program and Text by Craig Bruce  (csbruce@neumann.uwaterloo.ca)
  8.  
  9.               Interface Changed by Fender Tucker (May 8, 1996)
  10.  
  11.  
  12. 2.3. COPYING MS-DOS TO CBM-DOS
  13.  
  14. When you enter copy mode, the screen will clear and the name of each
  15. selected file is displayed as it is being copied.  If an error is
  16. encountered on either the MS-DOS or CBM-DOS drive during copying, an error
  17. message will be displayed and copying will continue (after you press a key
  18. for MS-DOS errors).
  19.  
  20. To generate a CBM-DOS filename from an MS-DOS filename, the eight filename
  21. characters are taken (including spaces) and a dot (.) and the three
  22. characters of the extension are appended.  Then, all spaces are removed,
  23. and if the name ends with a dot (.) character, then that dot character is
  24. removed as well.  I think this is fairly reasonable.
  25.  
  26. If there already is a file with the same filename on the CBM-DOS disk, then
  27. you will be prompted if you want to overwrite the file or not.  Entering an
  28. "n" will abort the copying of that file and go on to the next file, and
  29. entering a "y" (or anything else) will cause the CBM-DOS file to be
  30. "scratched" and then re-written.
  31.  
  32. The physical copying of the file is done completely in machine language and
  33. nothing is indicated on the screen while this is happening, but you can
  34. follow things by looking at das blinkin lichtes and listening for clicks
  35. and grinds. You will probably be surprised by the MS-DOS file reading speed
  36. (I mean in a good way).  The disk data is read in whole tracks and cached
  37. in memory and the directory information and the FAT are retained in memory
  38. as well.  The result is that minimal time is spent reading disk data, and
  39. no costly seeks are required for opening a new MS-DOS file.  A result is
  40. that small files are copied one after another very quickly.  You will have
  41. to wait, however, on the relatively slow standard kernel/Commodore-DOS file
  42. writing.
  43.  
  44. A few changes had to be made to the program to accomodate the RAMDOS
  45. program. RAMDOS uses memory from $2300 to $3FFF of RAM0, which is not
  46. really a good place for a device driver, and it uses some of the zero-page
  47. locations that I wanted to use.  But, difficulties were overcome.  The
  48. importance of RAMDOS compatibility is that if you only have one disk drive
  49. but you have an REU, you can use RAMDOS to store the MS-DOS files
  50. temporarily.  If you only have one disk drive and no REU, you are SOL (Out
  51. of Luck) unless you can get a RamDisk-type program for an unexpanded 128.
  52. The RAMDOS program is available from FTP site "ccosun.caltech.edu" in file
  53. "/pub/rknop/util128/ramdosii.sfx". One note I found out about RAMDOS: you
  54. cannot use a
  55.  
  56. DOPEN#1,(CF$),U(CD),W
  57.  
  58. with it like you are supposed to be able to; you have to use a
  59.  
  60. DOPEN#1,(CF$+",W"),U(CD)
  61.  
  62. Here is a table of copying speeds for copying from 1571s and 1581s with ASC
  63. and BIN translation modes.  All figures are in bytes/second.  These results
  64. were obtained from copying a 127,280 byte text file (the text of C= Hacking
  65. Issue #3).
  66.  
  67.    FROM    TO: "null"     RAMLink     RAMDOS     JD1581     JD1571
  68.   -------      ------     -------     ------     ------     ------
  69.    81-bin       5772        3441       2146        n/a        644
  70.    81-asc       5772        3434       2164        n/a        661
  71.    71-bin       4323        2991       1949       1821        n/a
  72.    71-asc       4323        2982       1962       1847        n/a
  73.  
  74. The "null" device is that "0" CBM-DOS device number, and a couple of
  75. entries are "n/a" since I only have one 1571 and one 1581.  Note that my 71
  76. and 81 are JiffyDOS-ified, so the performance of a stock 71/81 will be
  77. poorer.  JiffyDOS gives about a 2x performance improvement for the standard
  78. file accessing calls (open, close, chrin, chrout).  RAMDOS doesn't seem to
  79. be as snappy as you might think.
  80.  
  81. The "null" figures are quite impressive, but the raw sector reading speed
  82. without the overhead of mucking around with file organization is 6700
  83. bytes/sec for a 1581 and 4600 B/s for a 71.  The reason that the 1571
  84. operates so quickly is that I use a sector interleave of 4 (which is
  85. optimal) for reading the tracks.  I think that other MS-DOS file copier
  86. program uses an interleave of 1 (which is not optimal).  I lose some of the
  87. raw performance because I copy the file data internally once before
  88. outputting it (to simplify some of the code).
  89.  
  90. In a couple of places you will notice that ASC translation gives slightly
  91. better or slightly worse performance than BIN.  This is because although
  92. slightly more work is required to translate the characters, slightly fewer
  93. characters will have to be written to the CBM-DOS file, since PETSCII uses
  94. only CR where MS-DOS ASCII uses CR and LF to represent end-of-line.
  95. Translation is done by using a table (that you can change if you wish).
  96. Many entries in this table contain a value of zero, which means that no
  97. character will be output on translation.  Most of the control characters
  98. and all of the characters of value 128 (0x80) or greater are thrown away on
  99. being translated.  The table is set up so that CR characters are thrown
  100. away and the LF character is translated to a CBM-DOS CR character.  Thus,
  101. both MS-DOS ASCII files and UNIX ASCII files can be translated correctly.
  102.  
  103.  
  104. 2.4. COMMODORE-DOS MENU
  105.  
  106. The Commodore-DOS menu, which displays the names of the Commodore files
  107. selected for various operations, looks and works pretty much the same as
  108. the MS-DOS menu:
  109.  
  110.    CBMDOS  MS=10:1581  CBM=8  FREE=3211476
  111.  
  112.    NUM  S  TRN  FILENAME         T  LENGTH
  113.    ---  -  ---  ---------------- -  ------
  114.      1  *  BIN  LRR-128          P    9876
  115.      2     ASC  COM-HACKING-005  S  175412
  116.  
  117.    D - Directory  M - MS Device  F - CBM Device  C - Copy  Q=Quit
  118.    T - Toggle All  R - Remove  X - CBM Copy  / - Switch  +/- Page
  119.  
  120. You'll notice, however, that the filetype field ("T" here) is moved and is
  121. unchangable.  Also, the file lengths are not exact; they are reported as
  122. the block count of the file multiplied by 254.  This menu is not maintained
  123. for files being copied to the CBM-DOS disk from an MS-DOS disk.  You'll
  124. have to re-execute the Directory instruction to get an updated listing.
  125.  
  126. The "D" (directory) command has local effect when in this menu.  The
  127. Commodore-DOS directory will be loaded from the current CBM device number.
  128. Note that in order for this to work, the CBM device must be number eight or
  129. greater (a disk drive).  Originally, the subroutine for this command was
  130. written using only GET#'s from the disk and was very slow.  It was
  131. modified, however, to call a machine language subroutine to read the
  132. information for a directory entry from the directory listing, and hence the
  133. subroutine now operates at a tolerable speed.
  134.  
  135. The "C" (copy) command also has a different meaning when in this menu.  It
  136. means to copy the selected CBM files to the MS-DOS disk.  See details
  137. below.
  138.  
  139. The copy CBM files ("X") command is used to copy the files in the CBM-DOS
  140. menu to another CBM-DOS disk unit.  Select the files you want to copy and
  141. then press X.  You will then be asked what device number you want to copy
  142. the files to.  The device can be another disk drive or any other device
  143. (except the keyboard).  Using device number 0 does not mean the "null"
  144. device as it does with copying MS-DOS to CBM.  If you are copying to a disk
  145. device and the file already exists, then you will be asked if you wish to
  146. overwrite the file.  You cannot copy to the same disk unit.  Also, all
  147. files are copied in binary mode (regardless of what translation you have
  148. selected for a file).
  149.  
  150. The copy CBM files command was included since all of the low-level gear
  151. needed to implement it (specifically "commieIn" and "commieOut" below) was
  152. also required by other functions.  This command can be very convenient when
  153. working with RAMDOS.  For example, if you only had a 1571 as device 8 but
  154. you have a RAM expander and have installed RAMDOS as device 9, then you
  155. would copy MS-DOS files to RAMDOS using the MS-DOS menu, and then you would
  156. go to the Commodore-DOS menu ("/"), read the directory, select all files,
  157. insert an Commodore-DOS disk